<!doctype html>
<?php $conf= G('conf');?>
<html lang="<?php echo $conf['lang'];?>">
 
<head>
		<?php $header = G('header');?>
		<?php $user = G('user');?>
		<?php $menu = G('menu');?>
		<?php $forumlist_show = G('forumlist_show');?>
		<?php $route = G('route');?>
		<?php $conf = G('conf');?>
		<?php $static_version = $conf['static_version'];?>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Login</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="./admin/view/vendor/bootstrap/css/bootstrap.min.css">
    <link href="./admin/view/vendor/fonts/circular-std/style.css" rel="stylesheet">
    <link rel="stylesheet" href="./admin/view/libs/css/style.css">
    <link rel="stylesheet" href="./admin/view/vendor/fonts/fontawesome/css/fontawesome-all.css">
    <style>
    html,
    body {
        height: 100%;
    }

    body {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: center;
        align-items: center;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    </style>
</head>


<body>
	<!-- ============================================================== -->
	<!-- login page  -->
	<!-- ============================================================== -->
	<div class="splash-container">
		<div class="card ">
			<div class="card-header text-center"><a href="../index.html"><img class="logo-img" src="../view/img/Logo.jpg" alt="logo"></a><span class="splash-description">输入你的账号和密码以登录</span></div>
			<div class="card-body">
				<form id="form" action="<?php echo url('user-login');?>" method="post">
					<div class="form-group">
						<input type="text" id="email" name="email" placeholder="<?php echo lang('email');?> / <?php echo lang('username');?>" class="form-control form-control-lg">
					</div>
					<div class="form-group">
						<input type="password" id="password" name="password" placeholder="密码" class="form-control form-control-lg">
					</div>
					<button id="submit" type="submit" data-loading-text="<?php echo lang('submiting');?>..." class="btn btn-primary btn-lg btn-block">登录</button>
				</form>
			</div>
			<div class="card-footer bg-white p-0 ">
				<div class="card-footer-item card-footer-item-bordered">
					<a href="<?php echo url('user-create'); ?>" class="footer-link">新用户注册</a>
				</div>
				<div class="card-footer-item card-footer-item-bordered">
					<a href="<?php echo url('user-resetpw');?>" class="footer-link">忘记密码</a>
				</div>
			</div>
		</div>
	</div>
	
	<!-- ============================================================== -->
	<!-- end login page  -->
	<!-- ============================================================== -->
	<!-- Optional JavaScript -->
</body>



<script src="./admin/view/vendor/jquery/jquery-3.3.1.min.js"></script>
<script src="./view/js/xiuno.js<?php echo $static_version;?>"></script>
<script src="./admin/view/vendor/bootstrap/js/bootstrap.bundle.js"></script>
<script src="./view/js/md5.js"></script>


<script>
var jform = $('#form');
var jsubmit = $('#submit');
var jemail = $('#email');
var jpassword = $('#password');
var referer = '<?php echo $referer;?>';
jform.on('submit', function() {
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serializeObject();
	postdata.password = $.md5(postdata.password);
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			jsubmit.button(message).delay(1000).location(referer);
		} else if(xn.is_number(code)) {
			alert(message);
			jsubmit.button('reset');
		} else {
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsubmit.button('reset');
		}
		/*
		if(code == 0) {
			jsubmit.button(message).delay(1000).location(referer);
		} else if(code == 'email') {
			jemail.alert(message).focus();
			jsubmit.button('reset');
		} else if(code == 'password') {
			jpassword.alert(message).focus();
			jsubmit.button('reset');
		} else {
			alert(message);
			jsubmit.button('reset');
		}*/
	});
	return false;
});

</script>

<!--{hook user_login_js.htm}-->